CC	            = gcc

CFLAGS          = -O2

HDRS 	        = header.h 

LD              = $(CC)

MAKEFILE        = makefile

PROGRAM         = kmm3

SRCS            = $(wildcard *.c)

OBJS  = $(patsubst %.c,%.o,$(SRCS))

all:            $(PROGRAM)

$(PROGRAM):     $(OBJS) 
				        $(LD) $(OBJS) $(CFLAGS) -lm -o $(PROGRAM)

.c.o:
	$(CC) $(CFLAGS) -c $*.c

clean:;         rm -f $(OBJS) $(PROGRAM)

echo:;          @echo $(HDRS) $(SRCS) | tr ' ' '\n'
